package com.cos.shop.web.servlet;

import com.alibaba.fastjson.JSON;
import com.cos.shop.common.ResponseResult;
import com.cos.shop.service.TypeServices;
import com.cos.shop.service.impl.TypeServicesImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Copyright (C),2021-2022,亚瑟王
 * FileName: TypeController
 * Author: saber
 * Date:2022/9/17 11:29
 */
@WebServlet("/type")
public class TypeController extends BaseServlet {
    private TypeServices ts = new TypeServicesImpl();


    public String getAll(HttpServletRequest request, HttpServletResponse response){
        ResponseResult rr = ts.getAll();

        String jsonString = JSON.toJSONString(rr);

        return jsonString;
    }

} 
